﻿/*
 * XCoder v3.4.2011.0316
 * 作者：nnhy/X
 * 时间：2011-04-04 11:42:50
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace NXCMS.Sys
{
	/// <summary>
	/// 授权
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("授权")]
	[BindTable("Privilege", Description = "授权", ConnName = "Sys", DbType = DatabaseType.SqlServer)]
	public partial class Privilege
	{
		#region 属性
		private String _OwnerType;
		/// <summary>
		/// 类型
		/// </summary>
		[Description("类型")]
		[DataObjectField(true, false, false, 1)]
		[BindColumn(1, "OwnerType", "类型", "", "nvarchar(1)", 0, 0, true)]
		public String OwnerType
		{
			get { return _OwnerType; }
			set { if (OnPropertyChange("OwnerType", value)) _OwnerType = value; }
		}

		private String _Owner;
		/// <summary>
		/// 
		/// </summary>
		[Description("")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(2, "Owner", "", "", "nvarchar(100)", 0, 0, true)]
		public String Owner
		{
			get { return _Owner; }
			set { if (OnPropertyChange("Owner", value)) _Owner = value; }
		}

		private String _PrivType;
		/// <summary>
		/// 授权类型
		/// </summary>
		[Description("授权类型")]
		[DataObjectField(false, false, false, 40)]
		[BindColumn(3, "PrivType", "授权类型", "", "nvarchar(40)", 0, 0, true)]
		public String PrivType
		{
			get { return _PrivType; }
			set { if (OnPropertyChange("PrivType", value)) _PrivType = value; }
		}

		private String _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(4, "ID", "编号", "", "nvarchar(100)", 0, 0, true)]
		public String ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private String _Code;
		/// <summary>
		/// 代码
		/// </summary>
		[Description("代码")]
		[DataObjectField(false, false, false, 40)]
		[BindColumn(5, "Code", "代码", "", "nvarchar(40)", 0, 0, true)]
		public String Code
		{
			get { return _Code; }
			set { if (OnPropertyChange("Code", value)) _Code = value; }
		}

		private Boolean _Value;
		/// <summary>
		/// 值
		/// </summary>
		[Description("值")]
		[DataObjectField(false, false, false, 1)]
		[BindColumn(6, "Value", "值", "", "bit", 0, 0, false)]
		public Boolean Value
		{
			get { return _Value; }
			set { if (OnPropertyChange("Value", value)) _Value = value; }
		}

		private String _BackupNo;
		/// <summary>
		/// 备份编号
		/// </summary>
		[Description("备份编号")]
		[DataObjectField(false, false, true, 15)]
		[BindColumn(7, "BackupNo", "备份编号", "", "nvarchar(15)", 0, 0, true)]
		public String BackupNo
		{
			get { return _BackupNo; }
			set { if (OnPropertyChange("BackupNo", value)) _BackupNo = value; }
		}

		private String _BackupOperator;
		/// <summary>
		/// 备份操作者
		/// </summary>
		[Description("备份操作者")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(8, "BackupOperator", "备份操作者", "", "nvarchar(200)", 0, 0, true)]
		public String BackupOperator
		{
			get { return _BackupOperator; }
			set { if (OnPropertyChange("BackupOperator", value)) _BackupOperator = value; }
		}

		private DateTime _BackupTime;
		/// <summary>
		/// 备份时间
		/// </summary>
		[Description("备份时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(9, "BackupTime", "备份时间", "", "datetime2", 7, 0, false)]
		public DateTime BackupTime
		{
			get { return _BackupTime; }
			set { if (OnPropertyChange("BackupTime", value)) _BackupTime = value; }
		}

		private String _BackupMemo;
		/// <summary>
		/// 备份注释
		/// </summary>
		[Description("备份注释")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(10, "BackupMemo", "备份注释", "", "nvarchar(50)", 0, 0, true)]
		public String BackupMemo
		{
			get { return _BackupMemo; }
			set { if (OnPropertyChange("BackupMemo", value)) _BackupMemo = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "OwnerType" : return _OwnerType;
					case "Owner" : return _Owner;
					case "PrivType" : return _PrivType;
					case "ID" : return _ID;
					case "Code" : return _Code;
					case "Value" : return _Value;
					case "BackupNo" : return _BackupNo;
					case "BackupOperator" : return _BackupOperator;
					case "BackupTime" : return _BackupTime;
					case "BackupMemo" : return _BackupMemo;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "OwnerType" : _OwnerType = Convert.ToString(value); break;
					case "Owner" : _Owner = Convert.ToString(value); break;
					case "PrivType" : _PrivType = Convert.ToString(value); break;
					case "ID" : _ID = Convert.ToString(value); break;
					case "Code" : _Code = Convert.ToString(value); break;
					case "Value" : _Value = Convert.ToBoolean(value); break;
					case "BackupNo" : _BackupNo = Convert.ToString(value); break;
					case "BackupOperator" : _BackupOperator = Convert.ToString(value); break;
					case "BackupTime" : _BackupTime = Convert.ToDateTime(value); break;
					case "BackupMemo" : _BackupMemo = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得授权字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 类型
			///</summary>
			public const String OwnerType = "OwnerType";

			///<summary>
			/// 
			///</summary>
			public const String Owner = "Owner";

			///<summary>
			/// 授权类型
			///</summary>
			public const String PrivType = "PrivType";

			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 代码
			///</summary>
			public const String Code = "Code";

			///<summary>
			/// 值
			///</summary>
			public const String Value = "Value";

			///<summary>
			/// 备份编号
			///</summary>
			public const String BackupNo = "BackupNo";

			///<summary>
			/// 备份操作者
			///</summary>
			public const String BackupOperator = "BackupOperator";

			///<summary>
			/// 备份时间
			///</summary>
			public const String BackupTime = "BackupTime";

			///<summary>
			/// 备份注释
			///</summary>
			public const String BackupMemo = "BackupMemo";
		}
		#endregion
	}
}